import { axios } from '@/utils/request'

const api = {
  catList: '/plugins/food/cat/list',
  catAllList: 'plugins/food/cat/all-list',
  catChangeStatus: '/plugins/food/cat/change-status',
  catDel: '/plugins/food/cat/del',
  catEdit: '/plugins/food/cat/edit',
  goodsList: '/plugins/food/goods/list',
  goodsChangeStatus: '/plugins/food/goods/change-status',
  goodsDel: '/plugins/food/goods/del',
  goodsEdit: '/plugins/food/goods/edit',
  goodsBatch: '/plugins/food/goods/batch',
  getTableNumberList: '/plugins/food/table-number/list',
  addTableNumber: '/plugins/food/table-number/add',
  editTableNumber: '/plugins/food/table-number/edit',
  delTableNumber: '/plugins/food/table-number/del',
  downQrcode: '/plugins/food/table-number/down-qr',
  slideList: '/plugins/food/banner/list',
  slideEdit: '/plugins/food/banner/edit',
  slideDelete: '/plugins/food/banner/delete',
  order: '/plugins/food/order/list',
  getSetting: '/plugins/food/setting/get-setting',
  setSetting: '/plugins/food/setting/set-setting',
  getBookList: '/plugins/food/book/list',
  bookConfirm: '/plugins/food/book/confirm'
}

export default api

export function getCatList (parameter) {
  return axios({
    url: api.catList,
    method: 'get',
    params: parameter
  })
}

export function getCatAllList (parameter) {
  return axios({
    url: api.catAllList,
    method: 'get',
    params: parameter
  })
}

export function catChangeStatus (parameter) {
  return axios({
    url: api.catChangeStatus,
    method: 'post',
    data: parameter
  })
}

export function catDelItem (parameter) {
  return axios({
    url: api.catDel,
    method: 'post',
    data: parameter
  })
}

export function catEditItem (parameter) {
  return axios({
    url: api.catEdit,
    method: 'post',
    data: parameter
  })
}

export function getGoodsList (parameter) {
  return axios({
    url: api.goodsList,
    method: 'get',
    params: parameter
  })
}

export function goodsChangeStatus (parameter) {
  return axios({
    url: api.goodsChangeStatus,
    method: 'post',
    data: parameter
  })
}

export function goodsDelItem (parameter) {
  return axios({
    url: api.goodsDel,
    method: 'post',
    data: parameter
  })
}

export function goodsEditItem (parameter) {
  return axios({
    url: api.goodsEdit,
    method: 'post',
    data: parameter
  })
}

export function goodsBatch (parameter) {
  return axios({
    url: api.goodsBatch,
    method: 'post',
    data: parameter
  })
}

export function getTableNumberList (parameter) {
  return axios({
    url: api.getTableNumberList,
    method: 'get',
    params: parameter
  })
}

export function addTableNumber (parameter) {
  return axios({
    url: api.addTableNumber,
    method: 'post',
    data: parameter
  })
}

export function editTableNumber (parameter) {
  return axios({
    url: api.editTableNumber,
    method: 'post',
    data: parameter
  })
}

export function delTableNumber (parameter) {
  return axios({
    url: api.delTableNumber,
    method: 'post',
    data: parameter
  })
}

export function downQrcode (parameter) {
  return axios({
    url: api.downQrcode,
    method: 'get',
    params: parameter
  })
}

export function slideList (parameter) {
  return axios({
    url: api.slideList,
    method: 'get',
    params: parameter
  })
}

export function slideEdit (parameter) {
  return axios({
    url: api.slideEdit,
    method: 'post',
    data: parameter
  })
}

export function slideDelete (parameter) {
  return axios({
    url: api.slideDelete,
    method: 'post',
    data: parameter
  })
}

export function orderList (parameter) {
  return axios({
    url: api.order,
    method: 'get',
    params: parameter
  })
}

export function getSetting (parameter) {
  return axios({
    url: api.getSetting,
    method: 'get',
    params: parameter
  })
}

export function setSetting (parameter) {
  return axios({
    url: api.setSetting,
    method: 'post',
    data: parameter
  })
}

export function getBookList (parameter) {
  return axios({
    url: api.getBookList,
    method: 'get',
    params: parameter
  })
}

export function bookConfirm (parameter) {
  return axios({
    url: api.bookConfirm,
    method: 'post',
    data: parameter
  })
}
